<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title></title>
</head>
<body>
<div id="app">
    <label> 登录 </label>
    <input placeholder="请输入账号" v-model="account"/>
    <input placeholder="请输入账号" v-model="password"/>
    <input type="button" value="提交" @click = "dosubmit"/>
</div>


<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<script src="https://unpkg.com/axios/dist/axios.min.js"></script>

<script>
    var app = new Vue({
        el:'#app',
        data:{
            account:"",
            password:"",
        },
        methods:{
            dosubmit:function () {
                var formData = new FormData;
                formData.append("account",this.account);
                formData.append("password",this.password);
                axios.post("login",formData)
                .then(function (data) {
                    console.log("---传回的数据为---"+data.data)
                })

            }
        }
    })
</script>

</body>
</html>
